Field of the Invention
The present invention relates to a focus detection apparatus for an autofocus function of an imaging apparatus and, more particularly, to a focus detection apparatus for performing a focus detection of a phase difference method by using an image signal from an imaging element having a pixel for focus detection on an imaging plane and to an imaging apparatus having such a focus detection apparatus.
Description of the Related Art
In the related arts, as a focus detection method for focus control of an imaging apparatus, various kinds of methods such as phase difference method using a focus detection element, contrast method using a contrast component of an image of an imaging element, and the like have been proposed. There is such a technique that by using an arrangement in which pixels of an imaging element receive rays of light of different pupil planes of an imaging lens, a focus detection of the phase difference method is performed simultaneously with the image pickup.
In Japanese Patent Application Laid-Open No. 2001-083407 (Patent Literature 1), a ray of light which is converged by one microlens in one pixel is photoelectrically converted by divided photodiodes (hereinbelow, referred to as “PDs”), thereby allowing each PD to receive the rays of light of different pupil planes of an imaging lens. By such a construction, the focus detection in the imaging lens is performed by comparing outputs from the two PDs.
In Japanese Patent Application Laid-Open No. 2010-152161 (Patent Literature 2), a wiring layer existing on a front surface of a PD is made different in dependence on a pixel, thereby allowing rays of light of different pupil planes of an imaging lens to be received.
According to those techniques, an image shift amount is detected, that is, a phase difference is detected from the signals of the respective PDs which received the rays of light of the different pupil planes of the imaging lens and a defocus amount is calculated from the image shift amount, thereby performing the focus detection.
In Japanese Patent Application Laid-Open No. 2009-115893 (Patent Literature 3), the focus detection is performed by using both of the method of Patent Literature 2 and the contrast method.
In the case of the focus detection of the contrast method, there is such a problem that if an area which is used for the focus detection is set to be small, when a defocus amount of an object is small, an S/N ratio deteriorates, while an accuracy is raised. When the defocus amount is large, a focus detection area does not fit in a blurred image. If the area which is used for the focus detection is set to be large, it may happen more frequently that a plurality of objects exist within the focus detection area, while the S/N ratio is improved. Therefore, a possibility of an erroneous detection increases by what is called a perspective conflict in which a remote object and a near object exist mixedly within the focus detection area. Although the perspective conflict also occurs in the phase difference method, according to the contrast method, since the image is obtained by the imaging element, a size of image also depends on not only a size of object but also the defocus amount, that is, what is called a size of blurred image. Therefore, it is necessary to select an optimum focus detection area also in dependence on a degree of blurring.
Also in the case where the focus detection of the phase difference method is performed in the imaging element, a size of area to which the image is projected also depends on the defocus amount. Particularly, the wider a division range of an exit pupil of a photographing lens is, the more its influence is remarkable.
In the phase difference detection on the imaging element of the type in which the ray of light is divided by the PDs as disclosed in Patent Literature 1, since the outputs of the PDs are also used in the photographed image, the division range of the exit pupil is optimized to the photographed image and cannot be reduced to a small area for focus detection. At this time, it is necessary to optimize the size of focus detection area in accordance with a focus state in order to decrease the perspective conflict. Therefore, there is such a problem that if a focus detection arithmetic operation is executed a plurality of number of times by changing the size of focus detection area, it takes a time until a final focus detection result is obtained. Since it is necessary to execute the arithmetic operation a plurality of number of times to the image, such a problem that a buffer to store the image is necessary also occurs.
The invention is made in consideration of the foregoing problems and it is an aspect of the invention to provide a focus detection apparatus and an imaging apparatus in which focus detection operation results in a larger number of different focus detection areas can be obtained by a smaller number of frames and a time which is required until an in-focus state is obtained can be shortened.